#include<bits/stdc++.h>
using namespace std;
vector<long long>v;
int main(){
	freopen("mid.in" , "r" , stdin);
	freopen("mid.out" , "w" , stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	long long a;
	while(cin >> a , a){
		v.push_back(a);
	}
	if(v.size() % 2 == 0){
		long long k = v[v.size() / 2 - 1] + v[v.size() / 2];
		cout << k << " ";
	}
	else{
		long long k = v[v.size() / 2];
		cout << k << " ";
	}
	return 0;
}
